const crypto = require("crypto");
//最大长度
var maxlen=100;
function encryPtionimgName(name){
	name=encodeURIComponent(name)
		var md5 = crypto.createHash('md5');  
		var message = 'hello';
		var codes = md5.update(name, 'utf8').digest('hex'); //hex转化为十六进制
if(codes.length>=maxlen)
	codes=codes.slice(0,maxlen)+'=='+codes.length
	
	return codes.toLowerCase().replace(/%/g,'');
}

var arr=[
	'admin<manger>on虚拟商品0',
	'admin<manger>on虚拟商品1',
	'admin<manger>on虚拟商品2'
]
module.exports = encryPtionimgName;
